const router = require('koa-router')();
const number = require('../modules/number');

//获取数据
router.get('/schoolnumber',async(ctx,next) => {
    ctx.body = await number.getschoolNumber();
})
//增加数据
router.post('/schoolnumber',async(ctx,next) => {
    ctx.body = await number.addschoolNumber(ctx.request.body);
})
//删除数据
router.delete('/schoolnumber/:school_name/:exam_year',async(ctx,next) => {
    ctx.body = await number.deleteschoolNumber(ctx.params);
})
//修改数据
router.put('/schoolnumber',async(ctx,next)=>{
    ctx.body = await number.putschoolNumber(ctx.request.body);
})

module.exports = router;
